Fixed method to better the code structure