added model, factories and model tests