(cleanup) removes duplicate code