move some functions from Maths to Security