Improved add/remove class + updated idb