Refactoring
(cherry picked from commit b50ba06)