simplified _getLevel function