Close #60, restructuring and cleanup