Refactoring and UVa10603 progress