Rewritten with Ajax to clean js and make initialization