Refactor some methods and validation