refine overall functionality