refactoring and combined into a final product with some nice config
values