Refactoring
Further refactoring
Refactored original code - moved to a common folder