Refactored app
added joining threads