clean up style, modify conditions