core-5087 refactor code. fix loading and saving template avus