refactor: get rid of imperative-styled method