removed unused duplicate code