use pattern matching more

Y U NO PATTERN MATCH?!?