ugly long repetitive functions