add class method for initlization

add class method for initialization easier.