Restructuring and simplification

Restructured the code and removed a lot of 'unnecessary' parts. This
commit works on my 9-5 (i.e. the music plays).