Eliminated external dependencies
Added external helper functions