Refactor Angular controllers