Try to mimic the official SDK a bit more.