2317: refactor