properly parsing constructor
some semantic checks