refactoring, added in typedefs