Possible to configure settings and refactored the code a bit