refactor media queries, code cleanup