slight refactoring for beautification