Incremental commit with some refactoring