Fixed header margin, fixed footer, code refactorings