Moved model into separate library