Refactor splice method