Do some refactoring, get ready for deployment.