Working #85: Added some refactoring.