Moved code around a bit to satisfy mozilla/rust@14337