Add dropdown tile and cleanup js code