better parsing, not duplicated checks for modules