Cleanup and start to think how to determine function calls