Heavy refactoring to make it stronger as an generic concept