Remove un-used code and cleanup