Refactored model

broken into componenets