private functions moved