gets rid of fancy PHP closure stuff in exchange for backwards compatibility