exceptions and syntax cleaned