Refactor types into own file