add ff version and refactored code