Clean/refactor template