Add simple test + refactor