Centralize url check in one method