Collapse all code which relate to facebook into a module. Refactorcode of application winndow