cleanup and minor refactor to on way to 0.2