A sample code show how to decouple the functions