Refactored the restest models and added significant documentation.