add exceptions | change some code style