Cleaned this up a bit