cleanup: moved methods from a remote file to be local to their struct definition