added subroutines to reduce repetition and make easier to read
added subroutines to reduce repetition and make easier to read

Ensembl/ensembl-webcode,Ensembl/ensembl-draw,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode