clean mediaplayer code a bit