General cleanup and reorganizing