next unstable version, refactor code