Some refactoring and cleanup