WIP: code cleanup; trying to build