Is there any nicer way of doing this?