Fix code structure and do proper precheck