refactor security package structure