Move some stuff around for speed and for exception checking