refactoring moved magic numbers to config and deleted garbage