I have no idea if there's a better way of doing this..