reworked to play nicely with native methods