Base code for client and master modules