Pirana's internal functions