using dynamic types instead of static type to improve performance