move ember extension logic to shared function