refactor : extract slice