implement and refactor some methods.