Add support for GitHub/Bitbucket urls, refactoring