refactoring for the cust to dist app

refactoring for the cust to dist app