[CHG] Implemented some generics for better type safety
[CHG] Some minor refactorings and moving of components