Improved model.
Cleanup code.