move some functions from functions.cpp to others.cpp