Move code into a separate Python module