Cleaned up - needs xml to be used