refactored #6 to not use outside-events module