splitting functionality into common/client/server folders