Started refactoring the gem