refactoring & square working again