work on refactoring security