Refactor some code syntax