reformat core module code
fix samples