reducing more repetitive code into functions
tune type id and composer id now being extracted from DB as expected
using functions for repeating code