ftm: huge cleanup