Refactor helpers