refine implements of score.py