bug fixes and code reorg