improved performance of empty checking functions