Minor changes, refactoring