Refactor structure for clearer encapsulation