removing hardcodding and unwanted codes