Refactor complete. Fixed tests.