Pushed 'then' onto it's own line, reviewed code to try and resolve