using view model to try to mimic the php