Cleaned up wcma tool code