Cleaned up logic in main