The getUrl function makes a lot of sense and I like that idea better - I'll take a look at main.js from version 1 and do some refactoring.