removed casts; void* is automatically and safely promoted to other pointer type