refactored splitting string into keysize blocks