split private and public functions