Refactor for different sources