Reorganizes security implementation