Refactoring to reduce complexity of front-end + REST client modules