Define phases-handling module