use immediate function pattern to execute some code.