Complete refactore.