Refactor for Maven compatibility