performance improvements

use inline js instead of src attribute, improved DOM manipulation