a couple of handy macros for js