Refactoring and new API added