Reusable java code