refactor FB logic