refactoring to prepare for client side angular set up