some style and functional changes