refs: refactor code