Clean up and update source code with db changes