Move some private functions