Is it possible to use a constructor for the assignment of these values?