Moving a bit of logic around.

Signed-off-by: Ben Corlett <bencorlett@me.com>