refactor code, add files for graphics