Refatoring Pushqueue class