use immutable and add type annotations in constructor