cross-architecture support for different clients
refactor, bug fix