This code kinda smells funny.