string to int data refactor