Made the methods more modular