refactor fc to local, make more generic