refactored some legacy code from n64 (nw)