Major changes and refactoring...