Skxray refac

Not so sure about this change.