new field added and some code refactoring