Moved lib classes to models.