Cleanup

Minor cleanup done on a number of files. Re-arranging code into assets
and functions.