refactor 1 & 3