refactored way to build callback urls