Remove code smells (isInstanceOf). Closes #4.