FT code refactoring