Reorganize and general cleanup