refactor helpers