facebook refactor code