Add validate method and more type hinting