Refactor Iat JS class