Clean up and abstract settings a bit