Code cleanup and better filtering of fb