refactored sidebar to implement form