Improve function type and interface