Refactor float parsing