Moving generic functions from classes to toolbox