modified adapter, now cleaner, less code