Fixed method visibility and removed dead code