cleanup
Cleanup and restructure of machine block