refactored. ready for access control lab