optimize layout and add static cancel method.