refactoring into Types.hs