refactor 1: extract method