moving functions inside class