refactor(security):Refactor security module by breaking up into smaller and cohesive functions.
refactor(All Modules):Refactor all modules by breaking up into smaller and cohesive functions.