Refactoring services + controllers + directive