Cleaning up code. Ready for production use.