refactor add url monitor code