generalized user code