Relocate files, add comments and polish interfaces