move base url parsing into Utils module