reduce the lines of constructor