refactored templates to sub dirs; added support different versions and custom portal source dir