How do I make this more compact?