WCS fixing + refactoring