migrating more functions into the class