Added types and function handling