Refactored target make and removed duplicated code.