refactor splitting to util and builder classes