changed from overloads to instanceof checks