Move trim and split to utils module