Improved layout, generalized code some, general clean up