Improved generics code
removeAt duplication removed