Yikes, is this the cleanest way to implement it?