unnecesary files deletion
unnecessary if condition removed
object r replaced with AngularJS config params