refactoring: introduced private function for sending frames