change code style, add control API