add generic types and remove unnecessary statement