Refactored and cleaned up. Bumped version.