Refactored & removed useless code