Added config variables and cleaned up logging