Refactor: split up logic between modules
Use `;` instead of `&&` in case the sock file does not exist