Refactor to fold