fixups to code structure