further refactoring to achieve a more general variable naming