Simplify and fix code ApplicDepot MessageHandler