refactor and support slices