refactor into angular-based app