Changes min API level to 11

Also some code cleanup