refactor templates + allow file name setting + complex object input fix