Improves the readability and consistency of the codebase by replacing double quotes with single quotes where applicable. Also refactors several `if` statements and list/set comprehensions for brevity. The update does not affect functionality or performance. Unnecessary module imports were also removed for optimization.