Code cleanup, move settings into config file