Refactoring to remove internal state.
Refactoring errything. Code is much cleaner.