Cleaned up entity collision function