reorganized files and added some methods