spaces detect_space_type method for readability