fix copypasta error
some major refactoring from mean learnings