Added data types
Refactoring, fixes