code refactoring
Making changes compatible to v1