Refector code and prepare new features for 2.3