add new setting cleaned up parts of the code