Move Splitter inside function