cleanup, refactor of defmethods for file and httpx