Finished refactoring on-click method; it's in good shape