Making code more compact?