more cleanup
pattern matching