wip: refactor direction for trans in/out