Clean up codes
merge and clean code