We introduce the notion of an operating function on a subset of a Φ-algebra E. Then we use this notion to generalize results from Huijsmans and de Pagter (Proc. Lond. Math. Soc. 48:161-174, 1984) about the connection between vector subspaces and subalgebras of E. In the second part we investigate the analogous problem for operators.