refactored code + syntax