security package refactoring