Removed duplicate code and brackets