making build working on java 7 and adapting the builder to be more java friendly