Improve code
Improve code

Avoid code duplication.

LubyRuffy/haka,LubyRuffy/haka,haka-security/haka,nabilbendafi/haka,Wingless-Archangel/haka,nabilbendafi/haka,lcheylus/haka,Wingless-Archangel/haka,haka-security/haka,haka-security/haka,lcheylus/haka,nabilbendafi/haka,lcheylus/haka