Refactored a tiny bit to get rid of some indentation