Fix spelling mistake
Move controller methods to lib module.