encapsulated code avoiding globals