Clean up code and create Configuration classes