refactor: less copy/paste code