First steps of refactoring using q