Some logic extracted in methods.