refactor 2 to 3