Refactor app and backend build