Update for new code organization

Reorganize code into more logical structure.