added directives and refactored app