Quantity/time adjustment dialog added + refactoring