moved helper functions to pxd
.tweaks