tweak code and custom templates stuff