Refactor and remove duplicate code