extract and use parseInt. Fix imports