implemented parsing for media queries; code clean-up