Better way of doing it