Totally refactored.