Device cleanup

Note This is currently being rewritten and should be completed in February 2025 :)