using settings in a much better way
cleaner code