Empty template check added
Some refactorings related URLs