refactoring Slice.hs