Functionals implementation and tests