major refactor, added internal receive