Removed dead code
Added generics