huge code refactoring of Angular app to follow best practices