improved format and some cleanup