formatting/code duplication removal