Move loading and connection logic to their respective modules