Moved some calculation logic for workers out of the views