I solved the problem by keeping JBLineLayer and JBAreaLayer, but the latter now inherits from the first so ther hardly is any duplicate code.