Removed unused classes and functions, simplified for easier reading/translation