move splitting string to method