moved class funtion