split public and private functions