Refactor and consolidate logic