refactoring: separated the angular app from controller