lesson11:refactor method