Refactor and clean up
Clean up