Improve encapsulation using structs and methods