better design pattern for angular stuff