refactoring code as extending was not developer freindly