Cleanup... and some re-organizing