refactor to eliminate autoboxing