Refactory for Maxipix.py