edit: refactor