Make it more readable and remove unused codes