update merchant id and some most needed cleanup and security (bonus: doc)