refactoring Weave.java