minimac refactor: working, need clean up