Refactoring, integrate printing code form Android App