moved function parsing theme to external file