Some refactorings and add a feature that opens an url directly