merge logic from awp