minor cleanup, restructuring