Refactoring further
Removing duplicate code