Add support for >> brackets and cleanup code