restructuring functions code. add project example.