Use Position.z as int in stringstreams
Refactor onPrepareDeath code