Some refactoring + infer table name when no alias but only one table considered