Refactor scala recipe