Refactored into client server layout