Added support for untagged music, reorganized code