memory limit + tests refactor