began refactoring fb code