refactoring security methods and changing layout