Moved button code to partial for cleaner code