Refactored to remvoe duplicate code and move it to base classes and
implementations