refining code
final refining