queue improvements and misc cleanup