refactored after vimal review