code refactoring & directory access control