restructured app for further use with frontend framework