Refactor and add sonos