Pointers instead of ifs