replacing internal code with new gem