Refactored and adding new features.