minor, cleanup and restructuring