refactor code and create ctrl using angular.module