Further refactored to make as short as possible