start fixing code duplication