big refacto and add arquillian test