[WIP] App cleanup

Just some code housekeeping.