Implementing models and some logic