refactoring
merged changes from master