Apply Test Module and improve code