Moved complicated logic in view model