+1, I agree with @iNecas, it would be nice to modularize this a bit more.