refactor socket communication, add options panel