Fix unittest and clean up existing codes