Clean code and update min SDK from 8 to 11