Added logic for detecting syntax type