Move more methods to functions
Move more methods to functions
Move initialize node to a function
Move fix image paths to a function