Documentation and code refactory