refactor into io/controller