remove code dependency on Attach API classes, use reflection