clean up backend code