refactoring & added explanation to config