types refactoring - code is not compiling atm. will fix soon...