Implemented proper templating and fixed the layout in firefox