refactored codebase. Added two directives