Cleaning up Doctrine implementation, minor cleanups