Some small refactoring
Started adding types