cleaned up some logic