working; refactored needed;